﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;

namespace Infrastructure.Crosscutting.Comm.Service
{
    public class MethodInfoService
    {
        public static bool MethodReturnTypeIsTargetType(MethodInfo current, List<string> source)
        {
            var res = false;
            Type temp = current.ReturnType;
            do
            {
                var copy = temp;
                if (temp != null)
                {
                    if (source.Contains(temp.Name))
                    {
                        res = true;
                        break;
                    }
                    temp = copy.BaseType;
                }
            } while (temp != null);
            return res;
        }
    }
}
